/* GUI CONVERTED from rqrqiq3.p (converter v1.75) Sat Aug 12 23:13:05 2000 */
/* rqrqiq3.p - APPROVER'S REQUISITION INQUIRY                                 */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                        */
/* All rights reserved worldwide.  This is an unpublished work.               */
/*V8:ConvertMode=Report                                                       */
/*K1PD*/ /*V8#ConvertMode=Report                                              */
/* Revision: 8.6    LAST MODIFIED BY: 04/22/97  By: B. Gates          *J1Q2*  */


/* REVISION: 8.6E     LAST MODIFIED: 02/23/98   BY: *L007* A. Rahane          */
/* REVISION: 8.6E     LAST MODIFIED: 05/05/98   BY: *K1PD* A. Shobha          */
/* REVISION: 8.6E     LAST MODIFIED: 10/04/98   BY: *J314* Alfred Tan         */
/* REVISION: 8.6E     LAST MODIFIED: 09/09/99   BY: *J39R* Reetu Kapoor       */
/* REVISION: 9.1      LAST MODIFIED: 03/24/00   BY: *N08T* Annasaheb Rahane */
/* REVISION: 9.1      LAST MODIFIED: 08/12/00   BY: *N0KP* myb                */


/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

         {mfdtitle.i "b+ "}

/* ********** Begin Translatable Strings Definitions ********* */

&SCOPED-DEFINE rqrqiq3_p_1 "Open Only"
/* MaxLen: Comment: */

/* ********** End Translatable Strings Definitions ********* */

     {rqconst.i}
         define variable approver like rqa_apr no-undo.
         define variable open_only like mfc_logical label {&rqrqiq3_p_1}
        initial true.

         
/*GUI preprocessor Frame A define */
&SCOPED-DEFINE PP_FRAME_NAME A

FORM /*GUI*/ 
            
 RECT-FRAME       AT ROW 1 COLUMN 1.25
 RECT-FRAME-LABEL AT ROW 1 COLUMN 3 NO-LABEL VIEW-AS TEXT SIZE-PIXELS 1 BY 1
 SKIP(.1)  /*GUI*/
approver    colon 15
        usr_name    format "x(30)" no-label
        open_only
         with frame a side-labels width 80 attr-space NO-BOX THREE-D /*GUI*/.

 DEFINE VARIABLE F-a-title AS CHARACTER INITIAL "".
 RECT-FRAME-LABEL:SCREEN-VALUE in frame a = F-a-title.
 RECT-FRAME-LABEL:HIDDEN in frame a = yes.
 RECT-FRAME:HEIGHT-PIXELS in frame a =
  FRAME a:HEIGHT-PIXELS - RECT-FRAME:Y in frame a - 2.
 RECT-FRAME:WIDTH-CHARS IN FRAME a = FRAME a:WIDTH-CHARS - .5.  /*GUI*/

/*GUI preprocessor Frame A undefine */
&UNDEFINE PP_FRAME_NAME



         /* SET EXTERNAL LABELS */
         setFrameLabels(frame a:handle).

     FORM /*GUI*/  with STREAM-IO /*GUI*/  frame b down width 80 no-attr-space.
     /* SET EXTERNAL LABELS */
     setFrameLabels(frame b:handle).

     display global_userid @ approver open_only with frame a.

/*K1PD*/ {wbrp01.i}

         repeat:
/*K1PD*/ if c-application-mode <> 'WEB':U then
            set approver open_only with frame a editing:
               {mfnp.i usr_mstr
               approver usr_userid approver usr_userid usr_userid}

               if recno <> ? then do:
                  display usr_userid @ approver usr_name with frame a.
               end.
            end.
/*K1PD*/ {wbrp06.i &command = set
           &fields = "approver open_only"
           &frm = "a"}

/*K1PD*/ if c-application-mode <> 'WEB':U or
/*K1PD*/ ( c-application-mode = 'WEB':U and
/*K1PD*/ c-web-request begins 'DATA':U ) then do:
            find usr_mstr where usr_userid = approver no-lock no-error.

            if not available usr_mstr then do:
               {mfmsg.i 5605 3} /*USER ID DOES NOT EXIST*/
/*K1PD*/ if c-application-mode = 'WEB':U then  return.
               undo, retry.
            end.

            display usr_name with frame a.

            hide frame b no-pause.
            clear frame b all no-pause.
/*K1PD*/ end.

            {mfselprt.i "terminal" 80}
/*GUI*/ RECT-FRAME:HEIGHT-PIXELS in frame a = FRAME a:HEIGHT-PIXELS - RECT-FRAME:Y in frame a - 2.


         if open_only then do:
            for each rqm_mstr no-lock
               where rqm_rtto_userid = approver
/*J39R**         and rqm_open        = true:  */
/*J39R*/         and rqm_open        = true
/*J39R*/         and rqm_status      = "":

               display
                  rqm_nbr
                  rqm_rmks format "x(22)"
                  rqm_ent_date
                  rqm_need_date
                  rqm_rqby_userid
                  rqm_max_total
                  with frame b STREAM-IO /*GUI*/ .

                  down 1 with frame b.
            end.
        end.
        else do:
               for each rqm_mstr no-lock
               where rqm_rtto_userid = approver
                 by rqm_nbr:
                  display
                  rqm_nbr
                  rqm_rmks format "x(22)"
                  rqm_ent_date
                  rqm_need_date
                  rqm_rqby_userid
                  rqm_max_total
                  with frame b STREAM-IO /*GUI*/ .

                  down 1 with frame b.
               end.
        end.



            {mfreset.i}
/*GUI*/ {mfgrptrm.i} /*Report-to-Window*/

            {mfmsg.i 8 1}
         end.

/*K1PD*/ {wbrp04.i &frame-spec = a}
